//
//  FTSlideBar.h
//  FoodMaster
//
//  Created by 梁尚嘉 on 2017/1/20.
//  Copyright © 2017年 stree7. All rights reserved.
//

#import <UIKit/UIKit.h>

#define FT_SIZE(px) (([UIScreen mainScreen].bounds.size.width/380.f)*(px)/2.0f) //像素换算
#define FT_SCREEN_SIZE      [UIScreen mainScreen].bounds.size               //屏宽高结构体
#define FT_SCREEN_WIDTH     [UIScreen mainScreen].bounds.size.width         //屏宽
#define FT_SCREEN_HEIGHT    [UIScreen mainScreen].bounds.size.height        //屏高

@protocol FTSlideBarDataSource <NSObject>
- (NSUInteger)numOfItem;
- (NSString *)itemTitleAtIndex:(NSUInteger)index;
- (UIColor *)activeColor;
- (UIColor *)normalColor;
- (UIFont *)itemFont;
@end

@protocol FTSlideBarDelegate <NSObject>
@optional
- (void)didSelectItemAtIndex:(NSUInteger)index;

@end

@interface FTSlideBar : UIView

@property (nonatomic, weak) id<FTSlideBarDataSource> dataSource;
@property (nonatomic, weak) id<FTSlideBarDelegate> delegate;
@property (nonatomic, assign) NSUInteger selectedIndex;
- (void)reloadData;


- (void)setTitle:(NSString *)title atIndex:(NSUInteger)index;

@end
